<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="th/m/include/head :: head(~{::title}, ~{::style})">
    <meta charset="utf-8">
    <title>嵌套表格2</title>
    <style>
        /* 用白色盖住：没有更多数据了；因为要设水印的原因，在css.css中将mui-table-view的background-color设为了unset */
        .mui-table-view {
            background-color: #fff !important;
        }
        /*用白色盖往下拉后的loading图标*/
        .mui-scroll-wrapper {
            background-color: #fff !important;
        }
        .mui-pull-top-tips {
            margin-top: 10px;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <h1 class="mui-title">
        明细表
    </h1>
</header>
<div class="mui-content" id="op_con">
</div>

<div id="pullrefresh" class="mui-scroll-wrapper" style="margin-top: 90px;">
    <div class="mui-scroll">
        <!--数据列表-->
        <ul class="mui-table-view mui-table-view-chevron" id="ul_nest_sheet_select">

        </ul>
    </div>
</div>
<script src="../../weixin/js/macro/open_window_macro.js"></script>
<script src="../../weixin/js/mui.module_list_sel.js"></script>
<script th:inline="javascript">
    var skey = [[${nav.skey}]];
    var params = {
        "formCode":[[${dFormCode}]],
        "flowId":[[${flowId}]],
        "nestFieldName":[[${fieldCode}]],
        "actionId":[[${actionId}]],
        "parentCode":[[${parentCode}]],
        "skey":skey,
        "isEditable":[[${isEditable}]],
        "parentModuleCode":[[${parentModuleCode}]],
        "cwsId":[[${cwsId}]],
        "pageType":[[${pageType}]],
        "parentFields":'[(${parentFields})]' // parentFields中含有双引号
    };

    var options = {
        "isWx": [[${isWx}]],
        "ulContainer": "#ul_nest_sheet_select",
        "ajax_params": params,
        "url": AJAX_REQUEST_URL.NEST_SHEET_LIST,
        "ajaxDatasType": LIST_TYPE.NEST_SHEET_SELECT,
        "urlParams": '[(${urlParams})]&parentFields=' + encodeURIComponent('[(${parentFields})]')
    };
    // console.log(options);
    var content = document.querySelector('.mui-content');

    // 使mui-scroll-wrapper可以滚动
    mui('.mui-scroll-wrapper').scroll({
        bounce: true, // 是否启用回弹
        indicators: true, //是否显示滚动条
        deceleration: 0.0006 //阻尼系数,系数越小滑动越灵敏，默认0.0006
    });

    /*if(mui.os.plus) {
        // 该事件在鸿蒙中无效
        document.addEventListener('plusready', function() {
            var PullToRefrshListApi = new mui.PullToRefrshList(content,options);
            PullToRefrshListApi.loadListData();
        });
    }
    else {
        var PullToRefrshListApi = new mui.PullToRefrshList(content,options);
        PullToRefrshListApi.loadListData();
    }*/

    var PullToRefrshListApi = new mui.PullToRefrshList(content, options);
    PullToRefrshListApi.loadListData();
</script>
</body>
</html>